package gui.util;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JCheckBox;
import javax.swing.JTree;
import javax.swing.tree.TreeCellRenderer;

public class FileTreeNodeCellRenderer implements TreeCellRenderer {
	
	@Override
	public Component getTreeCellRendererComponent(JTree tree, Object value,
			boolean sel, boolean expanded, boolean leaf, int row,
			boolean hasFocus) {
		
		JCheckBox val = ((FileTreeNode)value).getFileCheckBox();
		
		if (sel) {
			val.setBackground(new Color(127, 127, 255));
		}
		else {
			val.setBackground(tree.getBackground());
		}

		return val;
	}
	
}
